import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        NGuessNumber n = new NGuessNumber();

        while(true){
            n.generateAnswer();
            while(!n.isWin()){
                n.getPlayerInput();
                n.compareGuessAnswer();
            }
            System.out.println("再玩一局？(输入y继续，其他退出)");
            Scanner sc = new Scanner(System.in);
            if (!sc.next().equals("y")){
                break;
            }
        }

    }
}
